﻿//-----------------------------------------------------------------------
// <copyright file="FacetLinkType.cs" company="Forebrain Technology, LLC">
//
// Copyright (c) Forebrain Technology, LLC. All rights reserved.
// 
// This source code is released under the Microsoft Public License (Ms-PL).
//
// </copyright>
//-----------------------------------------------------------------------
namespace PivotCollectionTools.Xml
{
    using System;
    using System.Xml.Serialization;

    /// <summary>
    /// A hyperlink that appears in the info panel only. Used to link to related collection or web-pages.
    /// </summary>
    [SerializableAttribute()]
    [XmlType(Namespace = "http://schemas.microsoft.com/collection/metadata/2009")]
    public class FacetLinkType : XmlNodeBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="FacetLinkType"/> class.
        /// </summary>
        public FacetLinkType() 
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="FacetLinkType"/> class.
        /// </summary>
        /// <param name="name">The name of the link.</param>
        /// <param name="linkUri">The link URI.</param>
        public FacetLinkType(string name, Uri linkUri)
        {
            this.Name = name;
            this.Href = linkUri.ToString();
        }

        /// <summary>
        /// Gets or sets the href.
        /// </summary>
        /// <value>The href of the facet link type.</value>
        [XmlAttributeAttribute(DataType = "anyURI")]
        public string Href { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name of the facet link type.</value>
        [XmlAttributeAttribute()]
        public string Name { get; set; }
    }
}
